Skip to content

feat(webhook): signed delivery with retries and dead-letter queue - #561

Open
ZacLou wants to merge 1 commit into
StableRoute-Org:mainfrom
ZacLou:feat/webhook-delivery-retry-dlq-552
Open

feat(webhook): signed delivery with retries and dead-letter queue#561
ZacLou wants to merge 1 commit into
StableRoute-Org:mainfrom
ZacLou:feat/webhook-delivery-retry-dlq-552

Conversation

@ZacLou

@ZacLou ZacLou commented Sep 5, 2026

Copy link
Copy Markdown

Summary

Implements signed webhook delivery with bounded retries and a dead-letter queue, as requested in #552.

Changes

  • HMAC signing: Every webhook payload is signed with X-Signature: t=<unix>,v0=<hex> using a per-webhook secret
  • Retry logic: Exponential backoff (1s, 2s, 4s) on HTTP 5xx, 408, 429, or network errors; max 3 attempts
  • Dead-letter queue: Failed deliveries are stored with failure reason, attempt count, and timestamp
  • DLQ API: GET /api/v1/webhooks/dlq lists dead-lettered entries; POST /api/v1/webhooks/dlq/:id/replay retries a delivery
  • Snapshot compatibility: Legacy webhooks loaded from old snapshots get a backfilled secret automatically
  • Tests: Added unit tests for signing, verification, delivery, retry exhaustion, and DLQ behavior

Security

  • SSRF-safe URL validation (isSafeWebhookUrl) already existed and is preserved
  • Signature includes timestamp and expires after 5 minutes to prevent replay attacks
  • Secrets are never logged or returned after creation

Fixes #552.

…ableRoute-Org#552)

- Add HMAC-SHA256 signing (X-Signature header + timestamp) to every webhook payload
- Deliver events with bounded retries and exponential backoff on 5xx/timeout
- Dead-letter exhausted deliveries with failure reason and replay support
- Backfill secrets for webhooks loaded from pre-signing snapshots
- Add DLQ list (GET /webhooks/dlq) and replay (POST /webhooks/dlq/:id/replay) endpoints
- Add comprehensive tests for signing, verification, delivery, and DLQ behavior
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

signed webhook delivery with retries and a dead-letter queue

1 participant